<%@ page import="com.itheima.domain.User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/20
  Time: 18:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理系统首页</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/allCss.css">
    <style>
        body{
            background-image: url("${pageContext.request.contextPath}/img/bg.png");
        }
    </style>
</head>
<body>
    <%
    //从session获取登录对象
    User user = (User) session.getAttribute("user");
    if (user == null) {
    //如果对象为空则显示登录链接
    %>
    <div id="false">
        <br/>
        <h2><a href="${pageContext.request.contextPath}/pages/login.jsp">请登录</a></h2>
        <br/>
    </div>
    <%
    //不为空则显示操作功能链接
    } else {
    %>
    <div id="true">
        <br/>
        <h2><a href="${pageContext.request.contextPath}/pages/add.jsp">添加学生</a></h2>
        <h2><a href="${pageContext.request.contextPath}/StudentServlet/search">查看学生</a></h2>
        <br/>
    </div>
    <%}%>
</body>
</html>
